//
//  CFLiveViewContriller.m
//  CFfuturestalent
//
//  Created by 子yu 刘 on 2018/4/25.
//  Copyright © 2018年 子yu 刘. All rights reserved.
//

#import "CFLiveViewContriller.h"
#import "CFLiveListCell.h"
#import "CFTutorViewController.h"

@interface CFLiveViewContriller ()<UITableViewDelegate,UITableViewDataSource>

@end

@implementation CFLiveViewContriller

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
     [self.navigationController setNavigationBarHidden:YES animated:animated];
}

- (void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
   
    if (@available(iOS 11.0, *)) {//解决隐藏导航栏scrollView不能到顶的问题
        self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    } else {
        self.automaticallyAdjustsScrollViewInsets = NO;
    }
}

- (void)viewDidLoad {
    [super viewDidLoad];
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 10;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return 175;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    CFLiveListCell * cell = [tableView dequeueReusableCellWithIdentifier:@"CFLiveListCell"];
    cell.selTutorBlock = ^(NSInteger index) {
        CFTutorViewController * tutorVC = (CFTutorViewController *)[CFUtility getVC:@"CFTutorViewController" Storyboard:LIVE];
        tutorVC.scrollIndex = index;
        [self.navigationController pushViewController:tutorVC animated:YES];
    };
    
    return cell;
}

@end
